<template>
	<view class="go-top">
		<uni-icons @click="goTop" type="arrow-up" size="30"></uni-icons>
	</view>
</template>

<script>
	export default {
		methods: {
			goTop() {
				uni.pageScrollTo({
					scrollTop:0,
					duration:100,
				})
			}
		},
	}
</script>

<style lang="scss">
	.go-top {
		width: 80rpx;
		height: 80rpx;
		position: fixed;
		bottom: 200rpx;
		right: 30rpx;
		border-radius: $uni-border-radius-circle;
		background-color: #fff;
		border: $uni-border-width $uni-border-style #000;
		opacity: .4;
		display: flex;
		justify-content: center;
		align-items: center;
		&:active{
			opacity: 1;
		}
	}
</style>